$(function () {
    let data = myAjax("/home", {}, "get");
    setNewsData(data.newsList);
    setProductData(data.productList)
})

function setNewsData() {

}
function setProductData(data) {
    let html='';
    for (let i=0;i<data.length;i++){
        if(i==0){
            html+='<div class="product-one">';
        }else {
            html+='<div class="product-two">';
        }
        html+='<div><img src="'+data[i].href+'" height="300" width="300"/></div>\n' +
            '                <div>\n' +
            '                    <h4>'+data[i].title+'</h4>\n' +
            '                    <p>'+data[i].content+'</p>\n' +
            '                </div>\n' +
            '            </div>';
    }
    $("#productHtml").html(html);
}